package com.common.db;

import java.io.Serializable;
import java.util.ArrayList;

public class PageCtrlDTO implements Serializable{

	private long rowCount;
	private long pageCount;
	private long rowCountPerPage;
	private long curPageNum;	
	private ArrayList result;

	public PageCtrlDTO(){
		
	}
	
	public PageCtrlDTO(ArrayList list, int irowCountPerPage , int icurPageNum){
	
		this.rowCount=list.size();
		this.rowCountPerPage = irowCountPerPage;
		this.pageCount=(rowCount%irowCountPerPage==0)?rowCount/irowCountPerPage:(rowCount/irowCountPerPage+1);
	    //this.result = (ArrayList) list.subList((icurPageNum-1)*irowCountPerPage,icurPageNum*irowCountPerPage);
	
	}
	/**
	 * @return curPageNum
	 */
	public long getCurPageNum() {
		return curPageNum;
	}
	/**
	 * @param curPageNum curPageNum
	 */
	public void setCurPageNum(long curPageNum) {
		this.curPageNum = curPageNum;
	}
	/**
	 * @return pageCount
	 */
	public long getPageCount() {
		return pageCount;
	}
	/**
	 * @param pageCount  pageCount
	 */
	public void setPageCount(long pageCount) {
		this.pageCount = pageCount;
	}
	/**
	 * @return result
	 */
	public ArrayList getResult() {
		return result;
	}
	/**
	 * @param result result
	 */
	public void setResult(ArrayList result) {
		this.result = result;
	}
	/**
	 * @return rowCount
	 */
	public long getRowCount() {
		return rowCount;
	}
	/**
	 * @param rowCount  rowCount
	 */
	public void setRowCount(long rowCount) {
		this.rowCount = rowCount;
	}
	/**
	 * @return rowCountPerPage
	 */
	public long getRowCountPerPage() {
		return rowCountPerPage;
	}
	/**
	 * @param rowCountPerPage rowCountPerPage
	 */
	public void setRowCountPerPage(long rowCountPerPage) {
		this.rowCountPerPage = rowCountPerPage;
	}
	
	
    

}
